import { Field, Int, ObjectType } from "@nestjs/graphql";
import { BaseEntity } from "../base.entity/base.entity";
import { Science } from "@prisma/client";
import { ClassesEntity } from "../classes.entity/classes.entity";
import { DepartmentEntity } from "../department.entity/department.entity";

@ObjectType()
export class ScienceEntity extends BaseEntity implements Science {
    hash: string;
    
    @Field(() => DepartmentEntity, { nullable: true })
    department?: DepartmentEntity

    @Field(() => Int)
    departmentId: number;

    @Field()
    name: string;

    @Field(() => [ClassesEntity], { nullable: true })
    Classes?: ClassesEntity[]
}
